<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ taglib uri="/WEB-INF/tlds/att.tld" prefix="att"%>
<html>

<head> 
<meta name="decorator" content="moduleEdit" />
<script type="text/javascript" src="${staticPath}/js/decimalinput.js"></script>
<link rel="stylesheet" href="${staticPath}/lib/ztree/3.5/css/zTreeStyle/zTreeStyle.css" type="text/css">
<script src="${staticPath}/js/jquery-dialog.js" type="text/javascript"></script>
<script src="${staticPath}/lib/ztree/3.5/js/jquery.ztree.all-3.5.js" type="text/javascript"></script>
<script src="${staticPath}/js/jQuery.FillOptions.js"></script>
<script type="text/javascript" src="${staticPath}/js/selectBerth.js"></script>
<link href="${staticPath}/lib/chosen/1.1.0/chosen.min.css" rel="stylesheet" type="text/css">
<script src="${staticPath}/lib/chosen/1.1.0/chosen.jquery.js" type="text/javascript"></script>
<script src="${staticPath}/js/ossp-jquery-chosen.js" type="text/javascript"></script>
<script type="text/javascript">
var num = '${fn:length(assbrand)}';
var num_items='${fn:length(assitems)}';
var num_base='${fn:length(assbaseitems)}';
var contextpath='${contextPath}';
var max_tr_contact ='${fn:length(leaseassociated.assTempItemCodeList)}';
var storeId1 ='${leaseassociated.storeId}'
var floorId1 ='${leaseassociated.floorId}'
var  formart ="${leaseassociated.formatId}"
var taxTypeCode ='${leaseassociated.taxTypeCode}'
var taxRateCode ='${leaseassociated.taxRateCode}'
var navId ='${navId}'
</script>
<script type="text/javascript" src="${staticPath}/js/contract.js"></script>
<style type="text/css">
#barndModal .modal-dialog  {width:60%;}
#assitems .modal-dialog  {width:60%;}
#assbasemodal .modal-dialog  {width:70%;}
#supplierModal .modal-dialog  {width:70%;}
</style>
</head>
<body>
 
<div class="Report_f">
           <div class="Report_f_1">
	<form:form id="contractForm" modelAttribute="leaseassociated" action="" method="post" class="form-horizontal" role="form" >
				
	<div class="Report_f_title_1">租赁
						<c:if test="${leaseassociated.isModifyContract =='1'}">变更</c:if>
						<c:if test="${leaseassociated.isModifyContract !='1'}">
						<ossp:value dictType="CONTRATC_ATTRIBUTE" key="${leaseassociated.contractAttribute}"></ossp:value>
						</c:if>合同
	</div>
		
			 <div>
			<input type="hidden" id='contract_type' value="leaseassociated">
			<input type="hidden" id='isModifyContract' name="isModifyContract" value="${leaseassociated.isModifyContract}">
			<input type="hidden" id="deleteContract" name="remove_Contact">
		   <ul class="nav nav-tabs Report_f_title_2" id="myTab">
			  <li class="active"><a href="#home" data-toggle="tab">合同基本信息</a></li>
			  <li><a href="#contractBrand_tab"  data-toggle="tab" >合同品牌信息</a></li> 
			  <li><a href="#contractBaseWhere_tab"  data-toggle="tab"  >销售分成及结算条款</a></li> 
			  <li><a href="#contractCommnWhere_tab"  data-toggle="tab"  >合同条件</a></li> 
			  <li><a href="#workflow" data-toggle="tab">流程审批</a></li> 
			  <li><a href="#diagram" data-toggle="tab">流程图</a></li>
			 </ul> 

			<div class="tab-content Report_f_title_3 " >
			  <div class="tab-pane active" id="home"	>
			  <div class="Report_f_title_4">
							<form:hidden path="mainId"/>
							<form:hidden path="versionUrl"/>
							<form:hidden path="versionId"/>
							<form:hidden path="assistId"/>
							<form:hidden path="historyId"/> 
							<form:hidden path="isNew"/>  
							<form:hidden path="id"/>
							<form:hidden path="contractAttribute"/>
							<form:hidden path="contractStatus"	/>
							<form:hidden path="recieveStatus"/>
							<form:hidden path="lastContractId"/>
							<form:hidden  path="createBy"/>
							<form:hidden path="operateState" />
							<input type="hidden" name="createTime"  value="<fmt:formatDate value="${leaseassociated.createTime}"  pattern="yyyy-MM-dd HH:mm:ss"/>"/>
							<tags:message content="${message}"/>
								<div class="f_2" hidden="hidden">
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3 control-label f_4">合同编号:</label>
										<div class="col-sm-6 f_6">
											<input id="contractNo"  name="contractNo"  value="${leaseassociated.contractNo}"     maxlength="200"  readonly="readonly"  class="f_5  readonly"  />
										</div>
									</div>
								
									<div class="form-group col-sm-6" >
										<label for="inputtext3" class="col-sm-3 control-label f_4">合同名称:</label>
										<div class="col-sm-6 f_6">
											<input  id="subject" name="subject"   maxlength="200" placeholder="租赁合同"    readonly class="f_5" />
										</div>
									</div>
							     </div>
				
								<div class="f_2">
									<div class="form-group col-sm-6" >
										<label for="inputtext3" class="col-sm-3 control-label f_4">管理区域:</label>
											<div class="col-sm-6 f_6">
												<form:hidden  id="areaId"  path="areaId"/> 
												<div class="input-group">
											      <input type="text" class="f_5" value="${leaseassociated.area}" id="area" name="area" readonly="readonly">
											       <span class="input-group-btn">
											        <button class="btn btn-default btn_3" id="areaDialog" type="button" >
											        	选择
											        </button>
											      </span>
											    </div>
											</div>
									</div>
									<div class="form-group col-sm-6">
										<div >
												<label for="inputtext3" class="col-sm-3 control-label f_4">签约门店:</label>
													<div class="col-sm-6 f_6">
														
													     <select  class="f_5" id="storeId" name="storeId">
	                        									<option value="">---请选择---</option>
	                        							 </select>
														 <form:hidden path="store" id="store" name="store"/>
													   
													</div>
											</div>
								</div>
							</div>
							<div class="f_2" >
								<div class="form-group col-sm-6" >
										<label for="floor" class="col-sm-3 control-label f_4">签约楼层:</label>
											<div class="col-sm-6 f_6">
												
											     <select type="email" class="f_5" id="floorId" name="floorId" onchange="cleanShop()">
	                        						<option value="">---请选择---</option>
	                        					 </select>
										  		 <form:hidden path="floor"/>
											    
											</div>
									</div>
							
								<div class="form-group col-sm-6">
								
										<label for="inputtext3" class="col-sm-3 control-label f_4">商铺号:</label>
											<div class="col-sm-6 f_6">
												<div class="input-group">
											      <input id="shop" name="assshopsList[0].shop" maxlength="200" value="${shopName}" readonly="readonly" class="f_5 required"/>
											      <input type="hidden" id="shopIds" name="assshopsList[0].shopIds" value="${shopId}" />
											      <span class="input-group-btn">
											        <button class="btn btn-default btn_3" id="shopDialog" type="button" >
											        	选择
											        </button>
											      </span>
											    </div>
											</div>
									</div>
								
						</div>
						<!-- *************************************************** -->	
						<div class="f_2">
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3 control-label f_4">合同签订面积:</label>
										<div class="col-sm-6 f_6">
											<input id="contractArea" name="contractArea" value="${leaseassociated.contractArea}" class="f_5 required" />
										</div>
									</div>
								
							
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3 control-label f_4">商铺面积分摊系数:</label>
										<div class="col-sm-6 f_6">
											<form:input id="areaCoefficient" path="areaCoefficient" maxlength="200" class="f_5 required"/>
										   
										</div>
									</div>
						</div>
							
							<!-- *************************************************** -->	
							<div class="f_2">
								
										<div class="form-group col-sm-6" >
											<label for="formatId_lab" class="col-sm-3 control-label f_4">业态:</label>
											<div class="col-sm-6 f_6">
											<select id="formatIdSelect" class="f_5" onchange="changeSelect('#formatId',this.options[this.options.selectedIndex].value)" >
											</select>
											<form:hidden id="formatId" name="formatId" path="formatId" maxlength="200" />
											  
											</div>
										</div>
									
							
										<div class="form-group col-sm-6">
											<label for="inputtext3" class="col-sm-3 control-label f_4">签约主体:</label>
											<div class="col-sm-6 f_6">
												<input id="signBodyName" value="${leaseassociated.baseShop.companyName}"  readonly="readonly" maxlength="200" readonly class="f_5 required"/>
											   <form:hidden  path="signBody" id="signBody" />
											</div>
										</div>
							</div>
		
							
							<!-- *************************************************** -->	
						<div class="f_2">
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3 control-label f_4">采购组织:</label>
										<div class="col-sm-6 f_6">
											<ossp:select   dictType="PGROUP" defaultSelected="${leaseassociated.purOrg}" onchange="changeSelect('#purOrg',this.options[this.options.selectedIndex].value)" class_="f_5 "></ossp:select>
											
											<form:hidden path="purOrg"/>
											
										</div>
									</div>
						
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3 control-label f_4">目标销售额:</label>
											<div class="col-sm-6 f_6"> 
												<form:input path="salesVolume" id="salesVolume"  maxlength="200" class="f_5 "/>
											</div>
									</div>
						</div>
							<!-- *************************************************** -->	
						<div class="f_2">
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3 control-label f_4">合同签订人:</label>
			
										<div class="col-sm-6 f_6">
												<div class="input-group">
											      	<form:hidden path="signById" id="signById"/>
											      <form:input id="signBy" readonly="true" path="signBy" maxlength="200" class="f_5 required"/>
											      <span class="input-group-btn">
											        <button class="btn btn-default btn_3" id="userDialogMultiple" data-dialog="dialog" data-multiple="true" data-idField="signById" data-nameField="signBy" data-authType="USER" type="button">
											        	选择
											        </button>
											      </span>
											    </div>
											</div>
									</div>
									<div class="form-group col-sm-6">
										<c:if test="${leaseassociated.isModifyContract == '1' }">
											<label for="inputtext3" class="col-sm-3 control-label f_4">合同生效日期:</label>
											<div class="col-sm-7">
												<div class="input-group date effectDate " data-date=""
													data-date-format="yyyy-mm-dd">
													<input class="f_5" type="text" readonly="readonly" id="effectDate" name="effectDate" value="<fmt:formatDate value="${leaseassociated.effectDate}"  pattern="yyyy-MM-dd"/>" />
													<span class="input-group-addon"><span
														class="glyphicon glyphicon-remove"></span></span> <span
														class="input-group-addon"><span
														class="glyphicon glyphicon-calendar"></span></span>
													</div>
												<span id="endDateMessage" class=" help-inline"
													style="color: red;"></span>
											</div>
										</c:if>
									</div>
						</div>
						
						<!-- *************************************************** -->	
						<div class="f_2">

									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3 control-label f_4">合同起始日期:</label>

										<div class="col-sm-7">
											<div class="input-group date startDate "  data-date-format="yyyy-mm-dd">
												<input class="f_5" readonly="readonly" id="startDate" type="text" name="startDate" value="<fmt:formatDate value="${leaseassociated.startDate}"  pattern="yyyy-MM-dd"/>" size="10"  /> 
												<span class="input-group-addon">
												<span
													class="glyphicon glyphicon-remove"></span></span> <span
													class="input-group-addon"><span
													class="glyphicon glyphicon-calendar"></span></span>

											</div>
										</div>
									</div>
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3 control-label f_4">合同终止日期:</label>
										<div class="col-sm-7">
											<div class="input-group date endDate "  data-date-format="yyyy-mm-dd">
												<input class="f_5" id="endDate"  name="endDate" size="10"  readonly="readonly" type="text"  value="<fmt:formatDate value="${leaseassociated.endDate}"   pattern="yyyy-MM-dd"/>" />
												<span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span> 
												<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
											</div>
											<span id="endDateMessage" class=" help-inline" style="color: red;"></span>
										</div>
									</div>

								</div>
							
							<div class="f_2">
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3 control-label f_4">文本开始日期:</label>
										<div class="col-sm-7">
											<div class="input-group date startDate "  data-date-format="yyyy-mm-dd">
												<input class="f_5" readonly="readonly" id="textStartDate" type="text" name="textStartDate" value="<fmt:formatDate value="${leaseassociated.textStartDate}"  pattern="yyyy-MM-dd"/>" size="10"  /> 
												<span class="input-group-addon">
												<span
													class="glyphicon glyphicon-remove"></span></span> <span
													class="input-group-addon"><span
													class="glyphicon glyphicon-calendar"></span></span>

											</div>
										</div>
									</div>
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3	 control-label f_4">文本结束日期:</label>
										<div class="col-sm-7">
											<div class="input-group date startDate "  data-date-format="yyyy-mm-dd">
												<input class="f_5" readonly="readonly" id="textEndDate" type="text" name="textEndDate" value="<fmt:formatDate value="${leaseassociated.textEndDate}"  pattern="yyyy-MM-dd"/>" size="10"  /> 
												<span class="input-group-addon">
												<span
													class="glyphicon glyphicon-remove"></span></span> <span
													class="input-group-addon"><span
													class="glyphicon glyphicon-calendar"></span></span>
											</div>
										</div>
									</div>
								</div>
							
								<!-- *************************************************** -->	
							
								<div class="f_2">
										<div class="form-group col-sm-8">
											<label for="inputtext3" class="col-sm-1	 control-label f_4">供应商:</label>
												<form:hidden path="supplierId" id="supplierId"/>
												<form:hidden path="supplierNo" id="supplierNo"/>
												<div class="input-group ">
											      <input id="supplierName" name="supplierName" value="${leaseassociated.supplierName}" maxlength="200" class="f_5" readonly="readonly"/>
											      <span class="input-group-btn">
											        <button class="btn btn-default btn_3" id="supplier"type="button">
											        	选择
											        </button>
											      </span>
											    </div>
										
										</div>
								</div>
										<!-- *************************************************** -->	
				
								<div class="f_2">
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3 control-label f_4">税票类型:</label>
										<div class="col-sm-6 f_6" id="taxTypeDiv">
											 <ossp:select dictType="INVOICE_TYPE" defaultSelected="${leaseassociated.taxTypeCode}" onchange="taxTypeChange(this.options[this.options.selectedIndex].value,this.options[this.options.selectedIndex].text)"    id="taxTypeCode_select" name="taxTypeCode_select" class_="f_5 " >
											 
											 </ossp:select>
											<form:hidden path="taxTypeCode" id="taxTypeCode" />
											<form:hidden path="taxType" id="taxType" />
										</div>
									</div>
							
							
								<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3 control-label f_4">税率:</label>
										<div class="col-sm-6 f_6">
											<select  class="f_5" id="taxRateCode_select" onchange="taxRateCodeChange(this.options[this.options.selectedIndex].value,this.options[this.options.selectedIndex].text)" name="taxRateCode_select">
											</select>
											<form:hidden path="taxRateCode" id="taxRateCode" />
											<form:hidden path="taxRate" id="taxRate" />
										</div>
									</div>
							</div>
							
						<div class="f_2">
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3	 control-label f_4">结算周期:</label>
											<div class="col-sm-6 f_6"> 
									
											<ossp:select class_="f_5" defaultSelected="${leaseassociated.settlementCycle}" dictType="BALANCE_CYCLE" onchange="changeSelect('#settlementCycle',this.options[this.options.selectedIndex].value)"></ossp:select>
											<form:hidden path="settlementCycle" id="settlementCycle"  maxlength="200" class="f_5 "/>
											</div>
									</div>
							
								<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3 control-label f_4">商户属性:</label>
										<div class="col-sm-6 f_6">
											<ossp:select class_="f_5" onchange="changeSelect('#isMainShop',this.options[this.options.selectedIndex].value)" dictType="IS_MAIN_SHOP" defaultSelected="${leaseassociated.isMainShop}"></ossp:select>
											
										   <form:hidden path="isMainShop" id="isMainShop"/>
										</div>
									</div>
							</div>
							
						<div class="f_2">
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3 control-label f_4">付款方式:</label>
											<div class="col-sm-6 f_6"> 
												<ossp:select dictType="PAYMENT_METHOD" defaultSelected="${leaseassociated.paymentMethod}"  class_="f_5" onchange="changeSelect('#paymentMethod',this.options[this.options.selectedIndex].value)" ></ossp:select>
												<form:hidden path="paymentMethod" id="paymentMethod"  maxlength="200" class="f_5 "/>
											</div>
									</div>
							
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-4	 control-label f_4">供应商经营方式:</label>
											<div class="col-sm-6 f_6"> 
												<ossp:select dictType="OPERATION_TYPE_LEASE"  defaultSelected="${leaseassociated.suppierOperation}"  class_="f_5" onchange="changeSelect('#suppierOperation',this.options[this.options.selectedIndex].value)" ></ossp:select>
												<form:hidden path="suppierOperation" id="suppierOperation"  maxlength="200" class="f_5 "/>
											</div>
									</div>
								
							</div>
						<div class="f_2">
								<div class="form-group col-sm-6">
											<label for="inputtext3" class="col-sm-3 control-label f_4">收银方式:</label>
											<div class="col-sm-6 f_6">
											<ossp:select class_="f_5 " onchange="changeSelect('#checkoutType',this.options[this.options.selectedIndex].value)" dictType="CONTRACT_CHCKOUTYPE" defaultSelected="${leaseassociated.checkoutType}"></ossp:select>
											<form:hidden id="checkoutType" path="checkoutType" maxlength="200" class="f_5 "/>
											  
											</div>
										</div>
								
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3 control-label f_4"> 撤柜日期:</label>
										<div class="col-sm-7">
										   <div class="input-group date terminateDate " data-date="" data-date-format="yyyy-mm-dd" >
										          <input class="f_5" id="terminateDate1" name="terminateDate1"  readonly value="<fmt:formatDate value="${leaseassociated.terminateDate}" type="both" pattern="yyyy-MM-dd"/> " size="10"  data-rule="" type="text" />
										           <input type="hidden" id="terminateDate" name="terminateDate"  value="<fmt:formatDate value="${leaseassociated.terminateDate}" type="both" pattern="yyyy-MM-dd"/>"/>
							                    <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
							                    <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
						                   
						                	</div>
	                					</div>
	                		
									</div>
								
							</div>
						<div class="f_3">	
								<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-3	 control-label f_4">历史合同号:</label>
										<div class="col-sm-6 f_6">
											<form:input path="historyContractNo" class="f_5 required"/>
										</div>
									</div>
						</div>
						<div class="f_2">
									<table class="table " id="table1">
										<thead>
											<tr>
													<th>费用项目</th>
													<th>费用内容</th>
											</tr>
										</thead>
										<tbody>
											<tr>
												<td>供应商用电</td>
												<td ><div class="col-sm-4">
												<ossp:radio id="isUndertakeElec_radio" name="isUndertakeElec_radio" defaultChecked="${leaseassociated.isUndertakeElec}" dictType="SUPPLIER_POWER" onchange="changeSelect('#isUndertakeElec',this.value)"></ossp:radio>
												<form:hidden id="isUndertakeElec" path="isUndertakeElec"/>
												</div></td>
											</tr>
									<%-- 			<tr>
													<td>自派导购</td>
												
													<td>
													<div class="col-sm-5"><ossp:radio dictType="GUIDE_TYPE" onchange="changeSelect('#guideType',this.value)">
														<form:hidden id="guideType" path="guideType"/>
													</ossp:radio></div>
													<div class="col-sm-5"><form:input disabled="true" id="guideAmount" path="guideAmount" maxlength="200"  class="f_5 required"/></div>
													</td>
												</tr> --%>
											<tr>
												<td>员工制服</td>
												<td><div class="col-sm-3">
												<ossp:radio  dictType="WORK_CLOTHES" defaultChecked="${leaseassociated.workClothes}" onchange="changeSelect('#workClothes',this.value)" name="workClothes_radio" ></ossp:radio>
												<form:hidden id="workClothes" path="workClothes"/>
												</div></td>
											</tr>
										
											<tr>
												<td>培训费</td>
												<td><div class="col-sm-3">
												<ossp:radio   dictType="COMMN_DICT" defaultChecked="${leaseassociated.isTraining}"  name="isTraining" ></ossp:radio>
												</div></td>
											</tr>
											<tr>
												<td>工卡费</td>
												
												<td><div class="col-sm-3">
												<ossp:radio  dictType="COMMN_DICT" defaultChecked="${leaseassociated.isJobCard}" name="isJobCard" ></ossp:radio>
												</div></td>
											</tr>
												<tr>
												<td>品牌形象维护费</td>
												<td><div class="col-sm-3">
												<ossp:radio  dictType="COMMN_DICT" defaultChecked="${leaseassociated.isBrandImage}"  name="isBrandImage" ></ossp:radio>
										
												</div></td>
											</tr>
										</tbody>
									</table>
								
							</div>
						<div class="f_2">
									<h4>
										合同条件--特殊条款信息 <input onclick="add_hidden('#hidden_contact','assTempItemCodeList')" 
										type="button" class="btn btn-success btn-sm pull-right" value="添加"></input>
									</h4>
									
									<table class="table table-striped table-hover o-l-table" id="codeTable">
										<thead>
											<tr>
												<th>扣款项<span style="color: red;" style="width: 100px">*</span></th>
												<th>条件</th>
												<th style="width: 120px">金额</th>
												<th style="width: 300px">描述</th>
												<th>操作</th>
											</tr>
										</thead>
										<tbody>
											<c:forEach items="${leaseassociated.assTempItemCodeList}" var="itemCode" varStatus="var">
												<tr>
												
													<td class="o-l-tab-ckb">
													<input type="hidden"  id="assTempItemCodeList${var.index}.id" name="assTempItemCodeList[${var.index}].id" value="${itemCode.id}">
													<select data_def="${itemCode.itemCode}" data_index="${var.index}" onchange="changeItem('hidden_contact',this,this.options[this.options.selectedIndex].value,this.options[this.options.selectedIndex].text)" class="f_5 required" id="assTempItemCodeList${var.index}.itemCode" name="assTempItemCodeList[${var.index}].itemCode">
												   </select>
													</td>
													<td class="o-l-tab-ckb">
													<select spt_Num="${itemCode.items.dicType}" data_def="${itemCode.itemCode}" data_index="${var.index}"  class="f_5 required" id="assTempItemCodeList${var.index}.conditions" name="assTempItemCodeList[${var.index}].conditions"></select>
													</td>
													<td class="o-l-tab-ckb"><input class="f_5" value="${itemCode.amount}" type="text" id="assTempItemCodeList${var.index}.amount" name="assTempItemCodeList[${var.index}].amount" class="f_5"></td>
													<td class="o-l-tab-ckb"><input type="text" value="${itemCode.remark}" id="assTempItemCodeList${var.index}.remark" name="assTempItemCodeList[${var.index}].remark" class="f_5 required"></td>
													<td class="o-l-tab-ckb"><input type="button"onclick="delete_tr(this,'#delContactId')" value="删除" class="btn btn-default btn-sm"></td>
												</tr>
											</c:forEach>
											<!-- 隐藏行，用于新增明细start -->
											<tr style="display: none" id="hidden_contact">
													<td class="o-l-tab-ckb"><select data_index="" onchange="changeItem('hidden_contact',this,this.options[this.options.selectedIndex].value,this.options[this.options.selectedIndex].text)" class="f_5 required" id=".itemCode" name=".itemCode"></select></td>
													<td class="o-l-tab-ckb"><select data_index=""  class="f_5 required" id=".conditions" name=".conditions"></select></td>
													<td class="o-l-tab-ckb"><input class="f_5" type="text" id=".amount" name=".amount"></td>
													<td class="o-l-tab-ckb"><input class="f_5 required" type="text" id=".remark" name=".remark"></td>
												<td><input type="button" onclick="delete_tr(this,'#delContactId')" value="删除" class="btn btn-default btn-sm"></td>
											</tr>
											<!-- 隐藏行，用于新增明细end -->
										</tbody>
									</table>
									<input type="hidden" name="delContactId" id="delContactId">
							</div>
								<!-- *************************************************** -->	
							<div class="f_3">
									<div class="form-group col-xs-12">
										<label for="inputtext3" class="col-sm-3 control-label">附件列表:</label>
										<div class="col-sm-9">
											<form:textarea id="contractAttachment" path="contractAttachment" htmlEscape="false" rows="3" class="form-control f_11"/>
										</div>
					
									</div>
							</div>
								<!-- *************************************************** -->	
							<div class="f_3">
								
									<div class="form-group col-xs-12">
										<label for="inputtext3" class="col-sm-3 control-label">备注:</label>
										<div class="col-sm-9">
											<form:textarea id="remarks"  path="remarks" htmlEscape="false" rows="3" class="form-control f_11"/>
										</div>
									
									</div>
							</div>
				 </div>
		      </div>
				  <div class="tab-pane" id="contractBrand_tab" >
				   <div class="panel-heading">
				    <a href="#" id="assbrands">添加</a>
				 	 </div>
			  		 <div> 
							<table class="table table-striped table-hover o-l-table" id="table1">
								<thead>
										<tr>
											<th style="width:1px"></th>
											<th>品牌</th> 
											<th>英文名称</th> 
										    <th>招商分类</th>
										    <th>品牌责任人</th>
										    <th>商铺</th>
										    <th>操作</th>
										</tr>
								</thead>
								<tbody id="tableBrand">
									<c:forEach items="${assbrand}" var="assbrand" varStatus="i">
										<tr>
											<td class="o-l-tab-ckb"><input style="display: none" name="assbrandBox" type="checkbox" value="${i.index }"/>
											<input type="hidden" id="assbrand_id${i.index }" name="assbrandsList[${i.index }].id" value="${assbrand.id}"/>
											<input type="hidden" id="brandNo${i.index }" name="assbrandsList[${i.index }].brandNo" value="${assbrand.brandNo}"/>
											<input type="hidden" id="brandId${i.index }" name="assbrandsList[${i.index }].brandId"  value="${assbrand.brandId}"/>
											<input type="hidden" id="brandCName${i.index }" name="assbrandsList[${i.index }].brandCName"  value="${assbrand.brandCName}" />
											<input type="hidden" id="brandEName${i.index }" name="assbrandsList[${i.index }].brandEName"  value="${assbrand.brandEName}" />
											<input type="hidden" id="brandLevel${i.index }" name="assbrandsList[${i.index }].brandLevel"  value="${assbrand.brandLevel}"  />
											<input type="hidden" id="brandAttribute${i.index }" name="assbrandsList[${i.index }].brandAttribute"  value="${assbrand.brandAttribute}"  />
											<input type="hidden" id="commodityCate${i.index }" name="assbrandsList[${i.index }].commodityCate"  value="${assbrand.commodityCate}" />
											<input type="hidden" id="inviteCate${i.index }" name="assbrandsList[${i.index }].inviteCate"  value="${assbrand.inviteCate}" />
											<input type="hidden" id="brandInviteHead${i.index }" name="assbrandsList[${i.index }].brandInviteHead"  value="${assbrand.brandInviteHead}" />
											<input type="hidden" id="memberRateType${i.index}" name="assbrandsList[${i.index }].memberRateType"  value="${assbrand.memberRateType}" />
											<input type="hidden" id="gcardDiscount${i.index}" name="assbrandsList[${i.index }].gcardDiscount"  value="${assbrand.gcardDiscount}" />
											<input type="hidden" id="gcardDiscount2${i.index}" name="assbrandsList[${i.index }].gcardDiscount2"  value="${assbrand.gcardDiscount2}" />
											<input type="hidden" id="ocardDiscount${i.index}" name="assbrandsList[${i.index }].ocardDiscount"  value="${assbrand.ocardDiscount}" />
											<input type="hidden" id="ocardDiscount2${i.index}" name="assbrandsList[${i.index }].ocardDiscount2"  value="${assbrand.ocardDiscount2}" /> 
											<input type="hidden" id="mainBarnd${i.index}" name="assbrandsList[${i.index }].mainBarnd"  value="${assbrand.mainBarnd}" /> 
											<input type="hidden" id="purchasingGroup${i.index}" name="assbrandsList[${i.index }].purchasingGroup"  value="${assbrand.purchasingGroup}" /> 
											<input type="hidden" id="assShopIds${i.index}" name="assbrandsList[${i.index}].assShopIds" value="<c:forEach items="${assbrand.assbsh}" var="assbsh" varStatus="j">${assbsh.shop.shopId},</c:forEach>" />
											<input type="hidden" id="shopNames${i.index}" name="assbrandsList[${i.index}].shopNames" value="<c:forEach items="${assbrand.assbsh}" var="assbsh" varStatus="j">${assbsh.shop.shop},</c:forEach>" />
											<input type="hidden" id="iszs${i.index}"name="assbrandsList[${i.index}].iszs"value="${assbrand.iszs}" />
											</td>
											<td class="o-l-tab-ckb" id="brandCName_td${i.index}">
												${assbrand.brandCName}
											</td>
											<td class="o-l-tab-ckb" id="brandEName_td${i.index}">
												${assbrand.brandEName}
											</td>
											<td class="o-l-tab-ckb" id="inviteCate_td${i.index}">${assbrand.cmcate.cateName}</td>
											<td class="o-l-tab-ckb" id="brandInviteHead_td${i.index}">${assbrand.brandInviteHead}</td>
											<td class="o-l-tab-ckb" id="shop_td${i.index}">
												
												<c:forEach items="${assbrand.assbsh}" var="assbsh" varStatus="j">
												${assbsh.shop.shop}
												<c:if test="${fn:length(assbrand.assbsh)}!=${j.index}">
												,
												</c:if>
														
												</c:forEach>
											</td>
											<td class="o-l-tab-ckb" ><a href="#" onclick="edit_brand(this,'${i.index}')" >修改</a>|<a href="#" onclick="remove_brand(this,'${i.index}')">删除</a></td>
										
										</tr>
						            </c:forEach>
								</tbody>
							</table>
					 </div>
				 </div>
				 <div class="tab-pane" id="contractBaseWhere_tab">
				 <div class="panel-heading">
				      <a href="#" id="assbase">添加</a>
				 	 </div>
			  		 <div> 
							<table class="table table-striped table-hover o-l-table" id="table1">
								<thead>
										<tr>
											<th style="width:1px"></th>
											<!--  <th>是否比高</th> --> 
											<th>保底</th>
										    <th>保底金额</th>
										    <th>扣款下限</th>
										    <th>扣款上限</th>
										    <th>扣率</th>
										    <th>开始日期</th>
										    <th>结束日期</th>
											<th>操作</th>
										</tr>
								</thead>
								<tbody id="contractBaseWhere">
										<c:forEach items="${assbaseitems}" var="assbaseitems" varStatus="i">
										<tr>
											<td class="o-l-tab-ckb">
											<input style="display: none" type="checkbox" name="assbaseitemsBox" value="${i.index }"/>
											<input type="hidden" id="assbaseitems_id${i.index }" name ="assbaseitemsList[${i.index }].id" value="${assbaseitems.id}"> 
											<input type="hidden" id="isGuarantee_base${i.index }" name ="assbaseitemsList[${i.index }].isGuarantee" value="${assbaseitems.isGuarantee}" class="f_5 "/>
											<input type="hidden" id="guaranteeType_base${i.index }" name ="assbaseitemsList[${i.index }].guaranteeType" value="${assbaseitems.guaranteeType}" />
											<input type="hidden" id="isCompare_base${i.index }" name ="assbaseitemsList[${i.index }].isCompare" value="${assbaseitems.isCompare}" />
											<input type="hidden" id="guaranteeAmount_base${i.index }" name ="assbaseitemsList[${i.index }].guaranteeAmount" value="${assbaseitems.guaranteeAmount}" /> 
											<input type="hidden" id="codeType_base${i.index }" name ="assbaseitemsList[${i.index }].codeType" value="${assbaseitems.codeType}" />
											<input type="hidden" id="lower_base${i.index }" name ="assbaseitemsList[${i.index }].lower" value="${assbaseitems.lower}" />
											<input type="hidden" id="upper_base${i.index }" name ="assbaseitemsList[${i.index }].upper" value="${assbaseitems.upper}" /> 
											<input type="hidden" id="deductRate_base${i.index }" name ="assbaseitemsList[${i.index }].deductRate" value="${assbaseitems.deductRate}" />
											<input  id="startDate_base${i.index }"  name ="assbaseitemsList[${i.index }].startDate" value="<fmt:formatDate value="${assbaseitems.startDate}" pattern="yyyy-MM-dd"/>" size="10"   type="hidden" />
											 <input id="endDate_base${i.index }" name ="assbaseitemsList[${i.index }].endDate" value="<fmt:formatDate value="${assbaseitems.endDate}" pattern="yyyy-MM-dd"/>" size="10"   type="hidden" />
											 <input type="hidden" id="validType_base${i.index }" name ="assbaseitemsList[${i.index }].validType" value="${assbaseitems.validType}" />
											 <input type="hidden" id="countBase_base${i.index }" name ="assbaseitemsList[${i.index }].countBase" value="${assbaseitems.countBase}" />
											 <input type="hidden" id="deductType_base${i.index }" name ="assbaseitemsList[${i.index }].deductType" value="${assbaseitems.deductType}" />
											 <input type="hidden" id="payDate_base${i.index }" name ="assbaseitemsList[${i.index }].payDate" value="${assbaseitems.payDate}" />
											 <input type="hidden" id="remarks_base${i.index }"  name ="assbaseitemsList[${i.index }].remarks" value="${assbaseitems.remarks}" />
											 <input type="hidden"  id="barndId_base${i.index }"  name ="assbaseitemsList[${i.index }].brandsId" value="${assbaseitems.brandsId}"  />	
											 <input type="hidden"  id="iscommGuarantee${i.index }" name ="assbaseitemsList[${i.index }].iscommGuarantee"  value="${assbaseitems.iscommGuarantee}"  />
											 <input type='hidden' id='status${i.index }' name='assbaseitemsList[${i.index }].status' 
											 
											 <c:choose>
														<c:when test="${not empty assbaseitems.status }"> 
															value='${assbaseitems.status}'
  														</c:when> 
  														<c:when test="${ empty assbaseitems.status }"> 
															value='00'
  														</c:when> 
													</c:choose>
											 />
											 <input type="hidden" id="assistId" name="assbaseitemsList[${i.index }].assistId" value="${assbaseitems.assistId }">
											</td>	
											<%-- <td><ossp:value dictType="COMPARE_HIGH" key="${assbaseitems.isCompare}"></ossp:value></td> --%>
											<td class="o-l-tab-ckb" id="isGuaranteeBase_td${i.index}"><ossp:value dictType="DEFEND_BASE" key="${assbaseitems.isGuarantee}"/></td>
											<td class="o-l-tab-ckb" id="guaranteeAmount_td${i.index}"><fmt:formatNumber value="${assbaseitems.guaranteeAmount}" pattern="#.00#"/></td>
											<td class="o-l-tab-ckb" id="lowerBase_td${i.index}"><fmt:formatNumber value="${assbaseitems.lower}" pattern="#.00#"/></td>
											<td class="o-l-tab-ckb" id="upperBase_td${i.index}"><fmt:formatNumber value="${assbaseitems.upper}" pattern="#.00#"/></td>
											<td class="o-l-tab-ckb" id="deductRateBase_td${i.index}"><fmt:formatNumber value="${assbaseitems.deductRate}" pattern="#.000#"/></td>
											<td class="o-l-tab-ckb" id="startDateBase_td${i.index}"><fmt:formatDate value="${assbaseitems.startDate}" pattern="yyyy-MM-dd"/></td> 
											<td class="o-l-tab-ckb" id="endDateBase_td${i.index}"><fmt:formatDate value="${assbaseitems.endDate}" pattern="yyyy-MM-dd"/></td> 
											<td class="o-l-tab-ckb">
<%-- 													<c:if test="${leaseassociated.isModifyContract == '1' }"> --%>
<!-- 														<a href="#" style="color: #ccc">修改</a>| -->
<!-- 														<a href="#" style="color: #ccc">删除</a>	 -->
<%-- 													</c:if> --%>
<%-- 													<c:if test="${leaseassociated.isModifyContract != '1' }"> --%>
														<a href="#" onclick="edit_base(this,'${i.index }')" >修改</a>|
														<a href="#" onclick="remove_assbaseitems(this,'${i.index }')">删除</a>
<%-- 													</c:if> --%>
											</td>
										</tr>
						           </c:forEach>
								</tbody>
							</table>
					 </div>
				 </div>
				 
				<div class="tab-pane" id="contractCommnWhere_tab" >
					 <div class="panel-heading">
					    <a href="#" id="add_assitems">添加</a>
				 	 </div>
			  		 <div> 
							<table class="table table-striped table-hover o-l-table" id="table1">
								<thead>
										<tr>
											<th style="width:1px"></th>
											<th>扣款项代码</th>
											<th>扣款项</th>
										    <th>金额</th>
										    <th >开始日期</th>
										    <th >结束日期</th>
										    <th>时效类型</th>
										    <th>计算基数</th>
										    <th>税率</th>
										    <th>操作</th>
										</tr>
								</thead>
								<tbody id="contractCommnWhere">
								<c:forEach items="${assitems}" var="assitems" varStatus="i">
										<tr>
											<td class="o-l-tab-ckb">
												<input type="checkbox" style="display: none"  name="assitemsBox" value="${i.index }" />
												<input type="hidden" id="assitems_id${i.index}" name="assitemsList[${i.index}].id" value="${assitems.id}"/>
												<input type="hidden" id="deductItem_items${i.index}" name="assitemsList[${i.index}].deductItem" value="${assitems.deductItem}"/>
												<input type="hidden" id="deductCate_items${i.index}" name="assitemsList[${i.index}].deductCate" value="${assitems.deductCate}" />
												<input type="hidden" id="amount_items${i.index}" name="assitemsList[${i.index}].amount" value="${assitems.amount}" />
												<input type="hidden" id="startDate_items${i.index}"  name="assitemsList[${i.index}].startDate" value="<fmt:formatDate value="${assitems.startDate}" pattern="yyyy-MM-dd"/>"  />
												<input type="hidden" id="endDate_items${i.index}"  name="assitemsList[${i.index}].endDate" value="<fmt:formatDate value="${assitems.endDate}" pattern="yyyy-MM-dd"/>"  />
												<input type="hidden" id="validType_items${i.index }" name="assitemsList[${i.index}].validType" value="${assitems.validType}" class="f_5 "/>
												<input type="hidden" id="countBase_items${i.index }" name="assitemsList[${i.index}].countBase" value="${assitems.countBase}" class="f_5 "/>
												<input type="hidden" id="deductType_items${i.index }" name="assitemsList[${i.index}].deductType" value="${assitems.deductType}" class="f_5 "/>
												<input type="hidden" id="deductCode_items${i.index }" name="assitemsList[${i.index}].deductCode" value="${assitems.deductCode}" class="f_5 "/>
												<input type="hidden" id="taxRate_items${i.index }" name="assitemsList[${i.index}].taxRate" value="${assitems.taxRate}" class="f_5 "/>
												<input type="hidden" id="taxRateCode_items${i.index }" name="assitemsList[${i.index}].taxRateCode" value="${assitems.taxRateCode}" class="f_5 "/>
												<input type="hidden" id="remarks_items${i.index }" name="assitemsList[${i.index}].remarks" value="${assitems.remarks}" class="f_5 "/>
											</td>
											<td id="deductCodeIteme_td${i.index }" class="o-l-tab-ckb">${assitems.deductCode}</td>
											<td id="deductItem_td${i.index }" class="o-l-tab-ckb">${assitems.deductItem}</td>
											<td id="amountIteme_td${i.index }" class="o-l-tab-ckb"><fmt:formatNumber value="${assitems.amount}" pattern="#.00#"/></td>
											<td  id="startDateitems_td${i.index }" class="o-l-tab-ckb"><fmt:formatDate value="${assitems.startDate}" pattern="yyyy-MM-dd"/></td>
											<td id="endDateitems_td${i.index }" class="o-l-tab-ckb"><fmt:formatDate value="${assitems.endDate}" pattern="yyyy-MM-dd"/></td>
											<td id="validTypeitems_td${i.index }" class="o-l-tab-ckb"><ossp:value dictType="DEFEND_SYTLE" key="${assitems.validType}"/></td> 
											<td id="countBaseitems_td${i.index }" class="o-l-tab-ckb"><ossp:value dictType="COMPUTE_BASE" key="${assitems.countBase}"/></td> 
											<td id="taxRateitems_td${i.index }" class="o-l-tab-ckb">${assitems.baseRate.taxRateRemark}</td> 
											<td class="o-l-tab-ckb">
<%-- 												<c:if test="${leaseassociated.isModifyContract == '1' }"> --%>
<!-- 													<a href="#" style="color: #ccc">修改</a>| -->
<!-- 													<a href="#" style="color: #ccc">删除</a>	 -->
<%-- 												</c:if> --%>
<%-- 												<c:if test="${leaseassociated.isModifyContract != '1' }"> --%>
													<a href="#" onclick="edit_assitems(this,'${i.index }')" >修改</a>|
													<a href="#" onclick="remove_assitems(this,'${i.index }')">删除</a>
<%-- 												</c:if> --%>
											</td>
										</tr>
						           </c:forEach>
								</tbody>
							</table>
					 </div>
				 </div>
				  <div class="tab-pane" id="workflow"> 
							<c:import url="/WEB-INF/views/bpm/workflow/workFlowInfo_edit.jsp">
								<c:param name="formName" value="com.maoye.ossp.biz.contract.entity.LeaseAssociated" />
								<c:param name="flowKey" value="LeaseAssociated" />
								<c:param name="businessId" value="${associatedContract.id}"/>
								<c:param name="method" value="${method}"/>
								<c:param name="isStart" value="${isStart}"/>
							</c:import> 			
					   </div>
						<div class="tab-pane" id="diagram" style="overflow-x:auto;">
							<iframe id="diagram_iframe" scrolling="no" frameborder=0 width="100%">
							</iframe>
					   </div>
			</div> 
		</div> 	 
		
		<div class="o-l-action">
              <a class="btn btn-danger btn_5 btn_right" role="button" href="${contextPath}/biz/contract/leaseassociated/list?navId=${navId}">返回</a>
               <shiro:hasPermission name="com.maoye.ossp.biz.contract.manage.LeaseAssociated:add">
					<c:if test="${leaseassociated.contractStatus=='00'}">
						  <button id="save" class="btn btn-success btn_5 btn_right" type="button">保&nbsp;存</button>
					</c:if>
			   </shiro:hasPermission>
			   <shiro:hasPermission name="com.maoye.ossp.biz.contract.manage.LeaseAssociated:submit">
			  	  <button id="submit_workFlower" class="btn btn-success btn_5 btn_right" type="button">提&nbsp;交</button>
			   </shiro:hasPermission>
         </div>
		
			</form:form>
 </div>
	</div>	

	<script type="text/javascript">
	var start=0;
	var end=0;
	$('.startDate').datetimepicker({
        language:  'zh-CN',
        weekStart: 1,
        todayBtn:  1,
		autoclose: 1,
		todayHighlight: 1,
		startView: 2,
		minView: 2,
		forceParse: 0,
		format: 'yyyy-mm-dd'
    })

	$('.endDate').datetimepicker({
        language:  'zh-CN',
        weekStart: 1,
        todayBtn:  1,
		autoclose: 1,
		todayHighlight: 1,
		startView: 2,
		minView: 2,
		forceParse: 0,
		format: 'yyyy-mm-dd'
    })
	$('.terminateDate').datetimepicker({
        language:  'zh-CN',
        weekStart: 1,
        todayBtn:  1,
		autoclose: 1,
		todayHighlight: 1,
		startView: 2,
		minView: 2,
		forceParse: 0,
		format: 'yyyy-mm-dd'
    })
	
	$('.effectDate').datetimepicker({
        language:  'zh-CN',
        weekStart: 1,
        todayBtn:  1,
		autoclose: 1,
		todayHighlight: 1,
		startView: 2,
		minView: 2,
		forceParse: 0,
		format: 'yyyy-mm-dd'
    })
</script>
<!-- Modal -->
<div class="modal fade" id="supplierModal" style="width:800" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-focus-on="input:first">></div> 
<div class="modal fade" id="barndModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-focus-on="input:first">></div> 		
<div class="modal fade" id="assitems"  tabindex="-1"  style="display: none;" data-focus-on="input:first">></div> 
<div class="modal fade" id="assbasemodal"  tabindex="-1"  style="display: none;" data-focus-on="input:first">></div> 	
<div class="modal fade" id="modalBrand"  tabindex="-1"  style="display: none;" data-focus-on="input:first"></div>
</body>
</html>